<script setup lang="ts">
const props = defineProps<{
  money: number
  modelValue: number
}>()
const emit = defineEmits<{
  (e: 'update:money', val: number): void
  (e: 'update:modelValue', val: number): void
}>()
const costMoney = () => {
  emit('update:money', props.money - 10)
}
const addScore = () => {
  emit('update:modelValue', props.modelValue + 10)
}
</script>

<template>
  <div class="son-comp-page">
    <h1>son-comp</h1>
    <h2>money{{ money }}</h2>
    <h2>score{{ modelValue }}</h2>

    <button @click="costMoney">花钱</button>
    <button @click="addScore">加分</button>
  </div>
</template>

<style scoped lang="scss"></style>
